<?php

class tsw_movingAvg implements ThermdSingleWidget
{
  public function drawWidget($io,$x,$y)
  {
    $white = imagecolorallocate($io,255,255,255);
    $black = imagecolorallocate($io,0,0,0);
    $icon = imagecreatefrompng(ThermdStats::$thermosrc.'cal.png');

    imagecopy($io,$icon,$x+81,$y,0,0,24,24);
		imagestring($io,1,$x+25,$y+4,"24HR",$black);
		imagestring($io,1,$x,$y+12,"MOVING AVERAGE",$black);	
		imagestring($io,1,$x+86,$y,strtoupper(date("M")),$white);
		imagestring($io,3,$x+86,$y+8,date("d"),$black);
		imagestring($io,4,$x+110,$y+4,ThermdStats::ts_getAverage(ThermdStats::$temperature_log_id).ThermdStats::$units,$black);
  }
}

?>